<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <script src="file:///android_asset/GggaApp.js"></script>
    <script>
      function Camera() {
        JgBridge.Camera({
          MethodName: 'Camera',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function Photo() {
        JgBridge.Photo({
          MethodName: 'Photo',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function IDCard() {
        JgBridge.IDCard({
          MethodName: 'IDCard',
          IdcardType: 2,
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function Passport() {
        JgBridge.Passport({
          MethodName: 'Passport',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function Car() {
        JgBridge.Car({
          MethodName: 'Car',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function QRCode() {
        JgBridge.QRCode({
          MethodName: 'QRCode',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function Close() {
        JgBridge.Close({
          MethodName: 'Close',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function Video() {
        JgBridge.Video({
          MethodName: 'Video',
          RecordTime: 5,
          IsNeedReadNumber: true,
          success: function(res) {
            alert('success:')
            document.getElementById('show').innerHTML = res.substring(0, 100)
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function Alipay() {
        JgBridge.Alipay({
          MethodName: 'Alipay',
          OrderInfo: '',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function WeChatPay() {
        JgBridge.WeChatPay({
          MethodName: 'WeChatPay',
          OrderInfo: {
            appid: 'wxd2f6896b1d647eba',
            noncestr: '6364d3f0f495b6ab9dcf8d3b5c6e0b01',
            partnerid: '1462538702',
            prepayid: 'wx281629034403386f27e7ddb03601326785',
            timestamp: '1548664148',
            sign: '8126a76fd765e7c19a98f8e29c5085c6'
          },
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function ReturnHome() {
        JgBridge.ReturnHome({
          MethodName: 'ReturnHome',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function ReFreshLoginInfo() {
        JgBridge.ReFreshLoginInfo({
          MethodName: 'ReFreshLoginInfo',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function ReCertify() {
        JgBridge.ReCertify({
          MethodName: 'ReCertify',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function GetLoginInfo() {
        JgBridge.GetLoginInfo({
          MethodName: 'GetLoginInfo',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function SetLoginInfo() {
        JgBridge.SetLoginInfo({
          MethodName: 'SetLoginInfo',
          loginInfo: { usercode: 'hzjg', username: '杭州集广' },
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function ReLogin() {
        JgBridge.ReLogin({
          MethodName: 'ReLogin',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function H5Verify() {
        JgBridge.H5Verify({
          MethodName: 'H5Verify',
          params: { module: '测试' },
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }

      function H5Auth() {
        JgBridge.H5Auth({
          MethodName: 'H5Auth',
          success: function(res) {
            alert('success:' + res)
            document.getElementById('show').innerHTML = res
          },
          fail: function(res) {
            alert('fail:' + res)
          }
        })
      }
    </script>
  </head>

  <body>
    <input type="button" value="设置用户信息" onclick="SetLoginInfo();" />

    <input type="button" value="获取用户信息" onclick="GetLoginInfo();" />

    <input type="button" value="拍照" onclick="Camera();" />

    <input type="button" value="选图片" onclick="Photo();" />

    <input type="button" value="扫一扫" onclick="QRCode();" />

    <input type="button" value="身份证" onclick="IDCard();" />

    <input type="button" value="扫护照" onclick="Passport();" />

    <input type="button" value="扫车牌" onclick="Car();" />

    <input type="button" value="关闭" onclick="Close();" />

    <input type="button" value="录像" onclick="Video();" />

    <input type="button" value="支付宝" onclick="Alipay();" />

    <input type="button" value="微信支付" onclick="WeChatPay();" />

    <input type="button" value="返回首页" onclick="ReturnHome();" />

    <input type="button" value="更新用户信息" onclick="ReFreshLoginInfo();" />

    <input type="button" value="依图" onclick="ReCertify();" />

    <input type="button" value="重新登录" onclick="ReLogin();" />

    <input type="button" value="二次认证" onclick="H5Verify();" />

    <input type="button" value="正常认证" onclick="H5Auth();" />
    <input id="file" type="file" multiple="multiple" /> <br />
    <p></p>
    <img src="" id="img" />

    <div id="show" style="background: red; width: 100%; height: 100px;"></div>

    <div id="video"></div>

    <img id="image" />

    <div id="imageShow" style="width:100%;height:auto;background-color:azure;"></div>
  </body>
</html>
